// 将下面两个共同的属性存放在这里面
class Person {
    age: number = 0
    name: string = '楷杰'

    constructor(name: string,age:number){
        this.name = name
        this.age = age
        console.log(age+1,name+'111')
    }
    eating(){
        console.log('eating');
    }
}
class Student extends Person {
    sno: number = 0
    
    constructor(name: string,age:number,sno:number){
        super(name,age)
        this.sno = sno
    }
    // 重写
    eating(){
        console.log('eating菜籽油');
    }
    studying(){
        console.log('studying');
    }
}

class Teacher extends Person {
    name: string = ''
    title: string = ''

    // eating(){
    //     console.log('eating');
    // }

    teaching(){
        console.log('teaching');
    }
}

const stu = new Student('速度可能',18,22)
console.log(stu.name);
console.log(stu.age);
console.log(stu.sno);
stu.eating()

export {}